package com.itbaizhan.test.exercise;

/**
 * get和set方法
 */
public class User2 {
    private int id;
    private String name;
    private boolean man;

    public void printUser(){
        System.out.println("User2.printUser");
    }
//也可以构造器
    public User2(int id, String name, boolean man) {
        this.id = id;
        this.name = name;
        this.man = man;
    }
//让其他也可以访问
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isMan() {
        return man;
    }

    public void setMan(boolean man) {
        this.man = man;
    }
}
